home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / glib-1.2 / gmodule.h < prev   
Encoding:
C/C++ Source or Header  |  2007-03-08  |  3.3 KB  |  101 lines

  1. /* GMODULE - GLIB wrapper code for dynamic module loading
  2.  * Copyright (C) 1998 Tim Janik
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Library General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the GNU
  12.  * Library General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Library General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * Modified by the GLib Team and others 1997-1999.  See the AUTHORS
  22.  * file for a list of people on the GLib Team.  See the ChangeLog
  23.  * files for a list of changes.  These files are distributed with
  24.  * GLib at ftp://ftp.gtk.org/pub/gtk/. 
  25.  */
  26.  
  27. #ifndef __GMODULE_H__
  28. #define __GMODULE_H__
  29.  
  30. #include <glib.h>
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif /* __cplusplus */
  35.  
  36. /* exporting and importing functions, this is special cased
  37.  * to feature Windows dll stubs.
  38.  */
  39. #define    G_MODULE_IMPORT        extern
  40. #ifdef NATIVE_WIN32
  41. #  define    G_MODULE_EXPORT        __declspec(dllexport)
  42. #else /* !NATIVE_WIN32 */
  43. #  define    G_MODULE_EXPORT
  44. #endif /* !NATIVE_WIN32 */
  45.  
  46. typedef enum
  47. {
  48.   G_MODULE_BIND_LAZY    = 1 << 0,
  49.   G_MODULE_BIND_MASK    = 0x01
  50. } GModuleFlags;
  51.  
  52. typedef    struct _GModule             GModule;
  53. typedef const gchar* (*GModuleCheckInit) (GModule    *module);
  54. typedef void         (*GModuleUnload)     (GModule    *module);
  55.  
  56. /* return TRUE if dynamic module loading is supported */
  57. gboolean    g_module_supported       (void);
  58.  
  59. /* open a module `file_name' and return handle, which is NULL on error */
  60. GModule*    g_module_open           (const gchar        *file_name,
  61.                         GModuleFlags     flags);
  62.  
  63. /* close a previously opened module, returns TRUE on success */
  64. gboolean    g_module_close           (GModule        *module);
  65.  
  66. /* make a module resident so g_module_close on it will be ignored */
  67. void        g_module_make_resident       (GModule        *module);
  68.  
  69. /* query the last module error as a string */
  70. gchar*        g_module_error           (void);
  71.  
  72. /* retrive a symbol pointer from `module', returns TRUE on success */
  73. gboolean    g_module_symbol           (GModule        *module,
  74.                         const gchar        *symbol_name,
  75.                         gpointer        *symbol);
  76.  
  77. /* retrive the file name from an existing module */
  78. gchar*        g_module_name           (GModule        *module);
  79.  
  80.  
  81. /* Build the actual file name containing a module. `directory' is the
  82.  * directory where the module file is supposed to be, or NULL or empty
  83.  * in which case it should either be in the current directory or, on
  84.  * some operating systems, in some standard place, for instance on the
  85.  * PATH. Hence, to be absoultely sure to get the correct module,
  86.  * always pass in a directory. The file name consists of the directory,
  87.  * if supplied, and `module_name' suitably decorated accoring to
  88.  * the operating system's conventions (for instance lib*.so or *.dll).
  89.  *
  90.  * No checks are made that the file exists, or is of correct type.
  91.  */
  92. gchar*        g_module_build_path      (const gchar        *directory,
  93.                        const gchar        *module_name);
  94.  
  95. #ifdef __cplusplus
  96. }
  97. #endif /* __cplusplus */
  98.  
  99.  
  100. #endif /* __GMODULE_H__ */
  101.